package com.access.boot.autoconfigure.apisdk.aop;

/**
 * @author Yangzhen
 * @date 2022/6/2 14:18
 * @since 1.0.0
 */
class MethodBeforeChangeableAdviceAdapter implements AdvisorAdapter {

    @Override
    public boolean supportsAdvice(Advice advice) {
        return advice instanceof MethodBeforeArgsChangeableAdvice;
    }

    @Override
    public MethodInterceptor getInterceptor(Advisor advisor) {
        MethodBeforeArgsChangeableAdvice methodBeforeAdvice = (MethodBeforeArgsChangeableAdvice) advisor.getAdvice();
        return new MethodBeforeChangeableAdviceInterceptor(methodBeforeAdvice);
    }
}
